<?php
namespace app\modules\frontend\controllers;

use Yii;
use yii\web\Controller;
use app\models\ProductSale;
use yii\data\ActiveDataProvider;
use app\models\TracePesticide;


class PesticideController extends Controller{

    public function actionIndex($id){

       // $this->layout='product';



        $sql="select * from shbb_trace_pesticide where batch_id=$id"; //在农药使用表中根据批次id溯源农药使用情况

        $models=TracePesticide::findBySql($sql)->all();
        // var_dump($dataProvider);
        return $this->renderAjax('index',['models'=>$models]); //将数据源传给index视图


    }
}